// src/components/CameraStream.js
import React, { useState, useEffect } from 'react';
import ReactPlayer from 'react-player';


const CameraStream = ({ rtspUrl }:any) => {
  const [playing, setPlaying] = useState(false);

  useEffect(() => {
    setPlaying(true);
    return () => {
      setPlaying(false);
    };
  }, []);

  return (
    <div>
      <ReactPlayer
        url={rtspUrl}
        playing={playing}
        width="100%"
        height="100%"
        controls
        playsinline
      />
    </div>
  );
};

export default CameraStream;